<template>
	<cl-select-table
		v-model="value"
		:title="'选择学员信息'"
		:service="service.student.student"
		:columns="columns"
		:multiple="multiple"
		:dict="{ text: 'name', value: 'id' }"
		pickerType="text"
	/>
</template>

<script setup lang="ts">
defineOptions({
	name: 'student-student-select'
});

import { useCool } from '/@/cool';
import { useI18n } from 'vue-i18n';
import { CrudProps } from '/#/crud';
import { ref, useModel, computed } from 'vue';

const props = defineProps({
	...CrudProps,
	modelValue: [String, Number, Array],
	multiple: Boolean
});

const { service } = useCool();
const { t } = useI18n();
const emit = defineEmits(['update:modelValue', 'change']);
// const value = useModel(props, "modelValue");
const value = computed({
	get() {
		return props.modelValue;
	},
	set(val) {
		emit('update:modelValue', val);
	}
});

const columns = ref([
	{ label: 'id', prop: 'id', minWidth: 140 },
	{ label: '姓名', prop: 'name', minWidth: 140 },
	{ label: '电话', prop: 'phone', minWidth: 140 }
]);
</script>
